#!/bin/sh
# checkam
# hack to get some feedback as to files that might be missing from Makefile.am

# Copyright (c) 1993-2020 Tim Riker

# This package is free software;  you can redistribute it and/or
# modify it under the terms of the license found in the file
# named COPYING that should have accompanied this file.
#
# THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.

echo "The following might need to be added to Makefile.am"
pwd=`pwd`
dirs=". `git ls-tree -dr --name-only HEAD`"
for dir in $dirs ; do
  if [ -f $dir/Makefile.am ] ; then
    cd $dir
    files=`git ls-tree --name-only HEAD`
    for file in $files ; do
      case $file in
	Makefile.am)
	;;
	*)
	grep -q "\<$file\>" Makefile.am || \
	  echo "$dir/$file"
	;;
      esac
    done
    cd $pwd
  else
    echo "$dir/Makefile.am"
  fi
done

# Local Variables: ***
# mode: sh ***
# tab-width: 8 ***
# sh-basic-offset: 2 ***
# sh-indentation: 2 ***
# indent-tabs-mode: t ***
# End: ***
# ex: shiftwidth=2 tabstop=8
